#ifndef D3D10SHAPES_SPHERE_H
#define D3D10SHAPES_SPHERE_H

#include "D3DUtilities.h"
#include "Vertex.h"

#include <vector>

namespace D3D10Shapes 
{
	class Sphere
	{
	public:
		Sphere();
		~Sphere();

		void init(ID3D10Device *device, const float radius, const unsigned __int32 numSlices, const unsigned __int32 numStacks);
		void draw();

	private:
		typedef std::vector<D3D10Utils::Vertex> VertexList;
		typedef std::vector<unsigned __int32> IndexList;

		void initStacks(VertexList& vertices, IndexList& indices);

	private:
		float mRadius;
		unsigned __int32 mNumSlices;
		unsigned __int32 mNumStacks;

		unsigned __int32 mNumVertices;
		unsigned __int32 mNumFaces;

		ID3D10Device *mDevice;
		ID3D10Buffer *mVertexBuffer;
		ID3D10Buffer *mIndexBuffer;
	};
}


#endif // D3D10SHAPES_SPHERE_H
